package com.akw;

import com.akw.bean.*;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.ConfigurableApplicationContext;

@SpringBootApplication
public class DemoApplication {

    public static void main(String[] args) {
        ConfigurableApplicationContext ioc = SpringApplication.run(DemoApplication.class, args);
        for (String s : ioc.getBeanNamesForType(Cat.class)) {
            System.out.println("cat:" + s);
        }
        for (String s : ioc.getBeanNamesForType(Dog.class)) {
            System.out.println("dog:" + s);
        }
        for (String s : ioc.getBeanNamesForType(User.class)) {
            System.out.println("user:" + s);
        }

        Pig pig = ioc.getBean(Pig.class);
        System.out.println(pig);

        Sheep sheep = ioc.getBean(Sheep.class);
        System.out.println(sheep);

    }

}
